home *** CD-ROM | disk | FTP | other *** search
- on buildIndex fromCast, toCast
- repeat with i = fromCast to toCast
- set currentField to the text of cast i
- repeat with j = 1 to the number of words in currentField
- set currentWord to word j of currentField
- if not ignorableWord(currentWord) then
- if endsWithPunctuation(currentWord) then
- set currentWord to removePunctuation(currentWord)
- end if
- set indexCast to the number of cast (currentWord && "INDEX")
- if indexCast <> -1 then
- set temp to the text of cast indexCast
- put RETURN & the name of cast i after temp
- put temp into field indexCast
- next repeat
- end if
- set newFieldNumber to findEmpty(cast (toCast + 5))
- put the name of cast i into field newFieldNumber
- set the name of cast newFieldNumber to currentWord && "INDEX"
- end if
- end repeat
- end repeat
- end
-
- on alphabetizeCasts fromCast, toCast
- set tempCast to findEmpty(cast toCast)
- put "TEMP" into field tempCast
- set the name of cast tempCast to "tempCast"
- repeat with i = fromCast to toCast - 1
- repeat with j = i + 1 to toCast - 1
- set firstCast to i
- set secondCast to j
- set firstName to the name of cast firstCast
- set secondName to the name of cast secondCast
- if firstName > secondName then
- set the name of cast tempCast to the name of cast firstCast
- put the text of cast firstCast into field tempCast
- set the name of cast firstCast to the name of cast secondCast
- put the text of cast secondCast into field firstCast
- set the name of cast secondCast to the name of cast tempCast
- put the text of cast tempCast into field secondCast
- set the name of cast tempCast to "tempCast"
- put "TEMP" into field tempCast
- end if
- end repeat
- end repeat
- end
-